var app = getApp()

Page({

  data: {
    flags: {},
  },

  onLoad: function() {

    this.getConfig();
  },

  getConfig: function () {
    var that = this
    wx.request({
      url: app.globalData.url + 'config/v/' + app.globalData.version,
      success: function (res) {
        // console.log(res)
        that.setData({
          flags: res.data.data
        })
      }
    })
  },

  gotoWeb: function(e) {
    var type = e.currentTarget.dataset.type
    wx.navigateTo({
      url: '/pages/web/web?type=' + type,
    })
  },

  onShareAppMessage: function() {
    var that = this
    return {
      title: '魔力画板',
      imageUrl: '/images/share.png',
      path: '/pages/index/index',
      success: function() {},
    }
  }
})